import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/4/12
 * Time:15:52
 **/
public class Main {
    /**
     * 每日一题-返回所有组的最大分值和
     * 60%
     *
     * @param args
     */
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int num = 0;
        int[] array = new int[3 * n];
        for (int i = 0; i < 3 * n; i++) {
            array[i] = sc.nextInt();
        }
        Arrays.sort(array);
        for (int i = 1; i <= n; i++) {
            num += array[2 * i - 1];
        }
        System.out.println(num);
    }

    /**
     * 每日一题-返回所有组的最大分值和
     * 100%
     * arr.length - 2 * (i + 1)
     * @param args
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int[] arr = new int[3 * n];
            int sum = 0;
            for (int i = 0; i < 3 * n; i++) {
                arr[i] = sc.nextInt();
            }
            Arrays.sort(arr);//先排序
            for (int i = 0; i < n; i++) {
                //i表示分为几组，找出中间值
                sum += arr[arr.length - (2 * (i + 1))];
            }
            System.out.println(sum);
        }
    }
}
